<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr">
    <head>
        <title><?php echo $application['appName'] ?> <?php echo $titrePage?></title>
<?php if (isset($clanLogo) === true) {?>
    	<link rel="icon" type="image/png" href="<?php echo $clanLogo; ?>" />
<?php }
else {?>
        <link rel="icon" type="image/png" href="<?php echo $baseUri ?>images/favicon.png" />
<?php }?>
        <link type="text/css" rel="stylesheet" href="<?php echo $baseUri ?>smartbok/css/structure.css" />
        <?php foreach ($css as $style) {
            if(strpos($style, 'IE') === false) {
                if (strpos($style, 'http') !== false) {?>
                <link type="text/css" rel="stylesheet" href="<?php echo $style ?>" />
                <?php }
                else {?>
        <link type="text/css" rel="stylesheet" href="<?php echo $baseUri ?><?php echo $style ?>" />
            <?php }
            } ?>
        <?php } ?>
    	<!--[if IE]>
    	<link type="text/css" rel="stylesheet" href="<?php echo $baseUri ?>smartbok/css/ie.css'" />
    	<?php foreach ($css as $style) {
    	    if(strpos($style, 'IE.css') === true) {?>
		<link type="text/css" rel="stylesheet" href="<?php echo $baseUri ?><?php echo $style ?>" />
            <?php } ?>
    	<?php } ?>
		<![endif]-->

		<!--[if IE 6]>
		<link type="text/css" rel="stylesheet" href="<?php echo $baseUri ?>smartbok/css/ie6.css'" />
		<?php foreach ($css as $style) {
    	    if(strpos($style, 'IE6.css') === true) {?>
		<link type="text/css" rel="stylesheet" href="<?php echo $baseUri ?><?php echo $style ?>" />
            <?php } ?>
    	<?php } ?>
		<![endif]-->

		<script type="text/javascript" src="<?php echo $baseUri ?>smartbok/js/smartbok.js"></script>
		<?php foreach ($js as $script) { ?>
    	    <script type="text/javascript" src="<?php echo $baseUri ?><?php echo $script ?>"></script>
    	<?php } ?>

    	<meta http-equiv="Content-Type" content="text/html;charset=<?php echo $charset ?>" />
    	<?php foreach ($metas as $meta) { ?>
    	    <?php echo $meta ?>
    	<?php } ?>
    	<?php if(isset($jsVars) === true) {?>
    	<script>
	    <?php foreach ($jsVars as $key => $value) {?>
	    var <?php echo $key?> = <?php echo $value ?>
	    <?php }?>    
    	</script>
    	<?php }?>

	</head>
	<body <?php echo $bodyJs ?>>
		<a href="#contenu" class="skiplink">Aller au contenu</a>
		<div id="main">
    		<div id="entete">
    		    <div id="logo">
    		        <?php if (isset($clanLogo) === true) {?>
    		            <img class="clanLogo" src="<?php echo $clanLogo; ?>" alt="logoClan" />
    		        <?php }?>
    		        <p class="logo">
    		        <?php if (isset($_COOKIE['account_id']) === true) {?>
    		            <a href="<?php echo $baseUri; ?>Membre/Accueil" title="Retour à l'accueil"><?php echo $_SESSION['clanInfo']['name']; ?></a>
    		        <?php }
    		        else { ?>
    		            <a href="<?php echo $cheminRes.$application['defaut'] ?>" title="Retour à l'accueil"><?php echo $application['appName']; ?></a>
    		        <?php } ?>
		            </p>    
		            <p class="description"><?php echo $application['description']?></p>
    		    </div>
    		    
    		</div>
		    <div id="navigation">
    		    <?php if ($accessOk !== false) {
        		    echo SmartbokMenu::afficher($menu, $cheminRes, $urlRewriting);
    		     }?>
    		</div>
    		

    		<?php if (isset($chemin) === true) { ?>
    			<div id="chemin">
        			<?php echo $sChemin ?>
    			</div>
    		<?php } ?>


    		<div id="corps">
    		    <?php if($application['afficherMessage'] === true) {?>
    		    <?php if(isset(SmartbokMessage::$aSmartbokMessages['erreur']) === true ){?>
    				<div id="erreur">
    					<?php foreach (SmartbokMessage::$aSmartbokMessages['erreur'] as $msg) {?>
        					<p><?php echo $msg ?></p>
    					<?php } ?>

        				<p class="close">
            				<a href="#" onclick="closeParent(this.parentNode)">[fermer]</a>
        				</p>
    				</div>
    			<?php } ?>
    		    <?php if(isset(SmartbokMessage::$aSmartbokMessages['alert']) === true ){?>
    				<div id="avertissement">
    					<?php foreach (SmartbokMessage::$aSmartbokMessages['alert'] as $msg) {?>
        					<p><?php echo $msg ?></p>
    					<?php } ?>

        				<p class="close">
            				<a href="#" onclick="closeParent(this.parentNode)">[fermer]</a>
        				</p>
    				</div>
    			<?php } ?>
    		    <?php if(isset(SmartbokMessage::$aSmartbokMessages['info']) === true ){?>
    				<div id="information">
    					<?php foreach (SmartbokMessage::$aSmartbokMessages['info'] as $msg) {?>
        					<p><?php echo $msg ?></p>
    					<?php } ?>

        				<p class="close">
            				<a href="#" onclick="closeParent(this.parentNode)">[fermer]</a>
        				</p>
    				</div>
    			<?php }
		        }?>

    			<a href="#" id="contenu"></a>
                <?php foreach ($templates as $template) {
                    if(file_exists('vues/'.$template)) {
                        require 'vues/'.$template;
                    }
                    elseif (file_exists($template)) {
                        require $template;
                    }
                    else {
                        $erreur = 'impossible d\'afficher le template';
                        require 'erreur.tpl.php';
                    }
                }?>                
			</div>
		</div>

	</body>
</html>